package WrittenTest;

import java.util.Scanner;

public class test15 {
    // 字符串中只包含数字的最长子串
    // 算法原理: 滑动窗口, 同向双指针
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        int n = str.length(), left = 0, right = 0, len = -1;
        // 用于更新最长数字子串的下标
        int retleft = -1, retright = -1;
        // 进窗口
        while (right < n) {
            if (str.charAt(right) >= '0' || str.charAt(right) <= '9') {
                left = right;
            }
            // 判断
            while (str.charAt(right) >= '0' && str.charAt(right) <= '9') {
                right++;
                // 防止 right指针越界
                if (right == n) {
                    break;
                }
            }
            // 出窗口, 更新结果
            if (str.charAt(left) >= '0' && str.charAt(left) <= '9' && str.charAt(right - 1) >= '0' && str.charAt(right - 1) <= '9') {
                if (right - left > len) {
                    len = right - left;
                    retleft = left;
                    retright = right;
                }
            }
            right++;
        }
        for (int i = retleft; i < retright; i++) {
            System.out.print(str.charAt(i));
        }
    }
}
